home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: lugb.latrobe.edu.au!latcs1!charan
- From: charan@latcs1.lat.oz.au (Software Access)
- Subject: Template Library as DOS *.lib
- Message-ID: <DLHpEJ.56p@latcs1.lat.oz.au>
- Organization: Comp Sci, La Trobe Uni, Australia
- Date: Sat, 20 Jan 1996 17:18:19 GMT
-
- Hi C++ Programmer.
- I have made a template which i compile into a static library for
- an exe.
- Using Borland's IDE.We'll i then create and instance of the library
- say PGI<int> *pgi;
- And try and link with the created library.
- Say pgilib.lib,which is supposed to be the library of the template
- PGI!.
- But when i compile it and link,the linker says "PGI<int>() and
- ~PGI<int>() not known.
- Doesn't know about it!.
- Do i have to export the functions within the template ?.
- What do i have to do ?.
- my template goes like this
-
- template <class T> PGI : public Vector {
- public:
- PGI();
- ~PGI();
- // And all the other public functions!.
- };
- Then in another file,
- I go
- PGI<int> *pgi;
- pgi = new PGI<int>;
- pgi->PGI_begin();
-
- Works fine if i run it in the same file as the implementation code.
- But as soon as i put it in another file apart from the source code
- file,the linker no longer knows the constructor,destructor and
- all the rest of the functions!.
-
- Any help will be appreciated!.
-
- Thanx in Advance.
- email:charan@latcs1.cs.latrobe.edu.au
-
-